package com.netflexitysolutions.amazonws.ec2.internal.operations;

import com.amazonaws.ec2.doc._2009_04_04.CreateSecurityGroupType;
import com.netflexitysolutions.amazonws.ec2.EC2;

public class CreateSecurityGroupOperation extends SingleObjectOperationExecutor<CreateSecurityGroupType, Boolean> {

	private String description;
	
	public CreateSecurityGroupOperation(EC2 ec2, String name, String description) {
		super(ec2, name);
		this.description = description;
	}

	@Override
	protected Boolean call(CreateSecurityGroupType request) {
		request.setGroupDescription(description);
		request.setGroupName(objectId);
		return getEC2().getService().createSecurityGroup(request).isReturn();
	}

}
